package com.kingdee.pda.ui.dialog;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.kingdee.pda.R;

/**
 * 加载弹框
 *
 * @author ZhuHuaHua
 * @date 2016/11/11 10:16
 */
public class LoadDialog extends BaseAlertDialog<LoadDialog> implements View.OnClickListener {
    private Context context;
    private View view;
    private TextView mTvLoad;

    public LoadDialog(Context context) {
        super(context);
        this.context = context;

    }

    @Override
    public View onCreateView() {
        view = LayoutInflater.from(context).inflate(R.layout.dialog_load, null);
        mLlContainer.addView(view);
        initView();
        return mLlContainer;
    }

    private void initView() {
        mTvLoad = view.findViewById(R.id.tv_dialog_loading);
        mTvLoad.setText(context.getString(R.string.tips_doing));
    }

    public void setTextView(String content) {
        if (mTvLoad == null) return;
        if (TextUtils.isEmpty(content)) {
            mTvLoad.setVisibility(View.GONE);
        } else {
            mTvLoad.setVisibility(View.VISIBLE);
            mTvLoad.setText(content);
        }
    }

    @Override
    public void setUiBeforShow() {
        super.setUiBeforShow();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {

        }
    }


}
